package com.daxue.bootckafka.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author daxue0929
 * @date 2022/10/24
 */

@Configuration
@ConditionalOnProperty(prefix="kafka",name = "isClose" ,havingValue = "true")
public class KafkaTemplateConfig {
    //默认应该已经有了KafkaTemplate的bean配置



    @ConditionalOnBean({String.class, List.class})
    @Bean("newMap")
    public Map newMap(){
        return new HashMap<String, Object>();
    }
}
